﻿#region header

//  ***************************************************************************
// *                                LICENSE
//  ***************************************************************************
//  * "Haplous" .NET Simple 2D Game Framework
//  * 
//  * Copyright © Jonathan Evans 2014-2014
//  * 
//  * This program is free software; you can redistribute it and/or
//  * modify it under the terms of the GNU General Public License
//  * as published by the Free Software Foundation; either version 2
//  * of the License, or (at your option) any later version.
//  * 
//  * This program is distributed in the hope that it will be useful,
//  * but WITHOUT ANY WARRANTY; without even the implied warranty of
//  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  * GNU General Public License for more details.
//  * 
//  * You should have received a copy of the GNU General Public License
//  * along with this program; if not, write to the Free Software
//  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//  * 
//  ***************************************************************************
//  * 
//  * Contact: opencollar@googlemail.com
//  * 
//  * Website: http://haplous.codeplex.com/
//  *
//  * NuGet:   http://www.nuget.org/packages/haplous/
//  *
//  * File:    Haplous/Haplous/Background.cs
//  *
//  ***************************************************************************

#endregion

using System.Diagnostics;

using Haplous.Correctness;

using JetBrains.Annotations;

namespace Haplous
{
    /// <summary>
    ///     A background that cannot interact in any way with other elements.
    /// </summary>
    [DebuggerDisplay("Background: Name={Name}")]
    public sealed class Background : Graphic
    {
        /// <summary>
        ///     A name that uniquely identifies this background.
        /// </summary>
        [NotNull]
        private readonly string _name;

        /// <summary>
        ///     Initializes a new instance of the <see cref="Background" /> class.
        /// </summary>
        /// <param name="game">
        ///     The game to which the class belongs.  The <paramref name="game" /> must not be
        ///     <see langword="null" />.
        /// </param>
        /// <param name="name">A name that uniquely identifies this background.</param>
        public Background([NotNull] Game game, [NotNull] string name) : base(game)
        {
            name.ValidateArgument("name", StringMustNotBe.NullOrEmptyOrWhiteSpace);
            _name = name;
        }

        /// <summary>
        ///     Gets a unique name that can be used to identify this object.
        /// </summary>
        /// <value>The unique name of this item.</value>
        /// <remarks>The name must never be <see langword="null" />, empty or whitespace.</remarks>
        public override string Name
        {
            get { return _name; }
        }
    }
}